 /**
 * @file tal_find_bind.h
 * @brief Common process - find & bind
 * @version 1.0.0
 * @date 2021-09-21
 *
 * @copyright Copyright 2018-2021 Tuya Inc. All Rights Reserved.
 *
 */
#ifndef __TAL_FIND_BIND_H__
#define __TAL_FIND_BIND_H__


#ifdef __cplusplus
    extern "C" {
#endif

#include "tuya_cloud_types.h"
#include "tuya_zigbee_stack.h"

/*
 *  zigbee finding & binding status
 */
typedef enum {
    TAL_FB_SUCCESS = 0,
    TAL_FB_FAILED,
} TAL_FB_STATUS_E;

/**
 * @brief zigbee finding & binding init as targter
 *
 * @param[in]   none
 * @return  OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */
OPERATE_RET tkl_zg_find_bind_targer_init(VOID_T);

/**
 * @brief zigbee finding & binding start as targter
 *
 * @param[in]   end_id: endpoint
 * @return  TRUE/ FALSE
 */
BOOL_T tal_zg_find_bind_targer_start(UINT8_T ep_id);

/**
 * @brief zigbee finding & binding stop as targter
 *
 * @param[in]   end_id: endpoint
 * @return  TRUE/ FALSE
 */
BOOL_T tal_zg_find_bind_targer_stop(UINT8_T ep_id);

/**
 * @brief zigbee finding & binding init as initiator
 *
 * @param[in]   none
 * @return  OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */
OPERATE_RET tal_zg_find_bind_initiator_init(VOID_T);

/**
 * @brief zigbee finding & binding start as initiator
 *
 * @param[in]   end_id: endpoint
 * @return  TRUE/ FALSE
 */
BOOL_T tal_zg_find_bind_initiator_start(UINT8_T ep_id);

/**
 * @brief zigbee finding & binding stop as initiator
 *
 * @param[in]   end_id: endpoint
 * @return  TRUE/ FALSE
 */
BOOL_T tal_zg_find_bind_initiator_stop(UINT8_T ep_id);

/**
 * @brief zigbee finding & binding complete callback
 * @note < this is a weak function you can rewrite this API in app layer >
 *
 * @param[in]   status: find & binding status
 * @return  none
 */
VOID tal_find_bind_initiator_complete_callback(TAL_FB_STATUS_E status);


#ifdef __cplusplus
}
#endif

#endif

